home *** CD-ROM | disk | FTP | other *** search
/ Personal Computer World 2006 May / PCWMAY06.iso / Software / Freeware / First Page 2006 3.00 / fp2006-final-3.00-setup.exe / {app} / Iscripts / Forms Misc / format-input.izs < prev    next >
Text File  |  2005-09-28  |  6KB  |  192 lines

  1. <!NOWIZARD>
  2.  
  3. <!TITLE>Format Input 
  4. <!/TITLE>
  5.  
  6. <!DESCRIPTION>Format the text case inside a form, reverse the text, or see the ASCII code behind the input.<!/DESCRIPTION> 
  7.  
  8. <!CATEGORY>Forms<!/CATEGORY>
  9.  
  10. <!SCRIPT>
  11. <!-- START OF SCRIPT -->
  12.  
  13. <!-- HOW TO INSTALL FORMAT INPUT:
  14.  
  15.   1.  Copy code into the HEAD section of document
  16.   2.  Put last coding into the BODY section of document  -->
  17.  
  18. <!-- STEP ONE: Add code into HEAD section of document  -->
  19.  
  20. <HEAD>
  21.  
  22. <SCRIPT LANGUAGE="JavaScript">
  23. <!-- Original:  Phillip Bryant (toxic1@fcmail.com) -->
  24. <!-- Web Site:  http://fly.to/toxic -->
  25.  
  26.  
  27. <!-- Begin
  28. function reverse() {
  29. text = "";
  30. str = document.forms[0].elements[0].value=document.forms[0].elements[0].value;
  31. for (i = 0; i <= str.length; i++)
  32. text = str.substring(i, i+1) + text;
  33. document.forms[0].elements[0].value = document.forms[0].elements[0].value = text;
  34. }
  35. function lower() {
  36. document.forms[0].elements[0].value = document.forms[0].elements[0].value.toLowerCase()
  37. }
  38. function caps() {
  39. document.forms[0].elements[0].value = document.forms[0].elements[0].value.toUpperCase()
  40. }
  41. function whatIsThis() {
  42. document.forms[0].elements[0].value = escape(document.forms[0].elements[0].value)
  43. }
  44. function dontLikeThis() {
  45. document.forms[0].elements[0].value = unescape(document.forms[0].elements[0].value)
  46. }
  47. var t = new Array();
  48. t[0] = "Here is some text to use as an example. Click on reverse, uppercase, or lowercase.";
  49. function example() {
  50. for(var i = 0; i < 2; i++) {
  51. if(document.forms[0].elements[i].value) {
  52. document.forms[0].elements[0].value = document.forms[0].elements[0].value+unescape(t[0]);
  53.       }
  54.    }
  55. }
  56. var f = new Array();
  57. f[0] = "%3Ca%20href%3D%27http%3A//www.evrsoft.com%27%3E%3Cimg%20src%3D%22http%3A//www.evrsoft.com/img/logo.gif%22%20alt%3D%27The%20JavaScript%20Source%21%27%20border%3D0%3E%3C/a%3E";
  58. function exAscii() {
  59. for(var i = 0; i < 2; i++) {
  60. if(document.forms[0].elements[i].value) {
  61. document.forms[0].elements[0].value = document.forms[0].elements[0].value+unescape(f[0]);
  62.       }
  63.    }
  64. }
  65. //  End -->
  66. </script>
  67.  
  68. </HEAD>
  69.  
  70. <!-- STEP TWO: Add code into BODY section of document  -->
  71.  
  72. <BODY>
  73.  
  74. <center>
  75. <form action="" method="post">
  76. <textarea rows=10 cols=40 wrap=soft></textarea>
  77. <table border=0><center>
  78. <tr><td>
  79. <input type=button value="Example" onClick="example(this.form)">
  80. <input type=button value="Reverse" onClick="reverse()">
  81. <input type=button value="All Upper" onClick="caps()">
  82. <input type=button value="All Lower" onClick="lower()">
  83. </td>
  84. </tr>
  85. <tr>
  86. <td>
  87. <input type=button value="Ascii Example" onClick="exAscii()">
  88. <input type=button value="UnAscii" onClick="dontLikeThis()">
  89. <input type=button value="Ascii" onClick="whatIsThis()">
  90. <input type=button value="Clear It" onClick="reset()">
  91. </td>
  92. </tr>
  93. </table>
  94. </form>
  95. </center>
  96.  
  97.  
  98. <!-- END OF SCRIPT -->
  99. <!/SCRIPT>
  100.  
  101. <!PREVIEW>
  102. <!-- START OF SCRIPT -->
  103.  
  104. <!-- HOW TO INSTALL FORMAT INPUT:
  105.  
  106.   1.  Copy code into the HEAD section of document
  107.   2.  Put last coding into the BODY section of document  -->
  108.  
  109. <!-- STEP ONE: Add code into HEAD section of document  -->
  110.  
  111. <HEAD>
  112.  
  113. <SCRIPT LANGUAGE="JavaScript">
  114. <!-- Original:  Phillip Bryant (toxic1@fcmail.com) -->
  115. <!-- Web Site:  http://fly.to/toxic -->
  116.  
  117.  
  118. <!-- Begin
  119. function reverse() {
  120. text = "";
  121. str = document.forms[0].elements[0].value=document.forms[0].elements[0].value;
  122. for (i = 0; i <= str.length; i++)
  123. text = str.substring(i, i+1) + text;
  124. document.forms[0].elements[0].value = document.forms[0].elements[0].value = text;
  125. }
  126. function lower() {
  127. document.forms[0].elements[0].value = document.forms[0].elements[0].value.toLowerCase()
  128. }
  129. function caps() {
  130. document.forms[0].elements[0].value = document.forms[0].elements[0].value.toUpperCase()
  131. }
  132. function whatIsThis() {
  133. document.forms[0].elements[0].value = escape(document.forms[0].elements[0].value)
  134. }
  135. function dontLikeThis() {
  136. document.forms[0].elements[0].value = unescape(document.forms[0].elements[0].value)
  137. }
  138. var t = new Array();
  139. t[0] = "Here is some text to use as an example. Click on reverse, uppercase, or lowercase.";
  140. function example() {
  141. for(var i = 0; i < 2; i++) {
  142. if(document.forms[0].elements[i].value) {
  143. document.forms[0].elements[0].value = document.forms[0].elements[0].value+unescape(t[0]);
  144.       }
  145.    }
  146. }
  147. var f = new Array();
  148. f[0] = "%3Ca%20href%3D%27http%3A//www.evrsoft.com%27%3E%3Cimg%20src%3D%22http%3A//www.evrsoft.com/img/logo.gif%22%20alt%3D%27The%20JavaScript%20Source%21%27%20border%3D0%3E%3C/a%3E";
  149. function exAscii() {
  150. for(var i = 0; i < 2; i++) {
  151. if(document.forms[0].elements[i].value) {
  152. document.forms[0].elements[0].value = document.forms[0].elements[0].value+unescape(f[0]);
  153.       }
  154.    }
  155. }
  156. //  End -->
  157. </script>
  158.  
  159. </HEAD>
  160.  
  161. <!-- STEP TWO: Add code into BODY section of document  -->
  162.  
  163. <BODY>
  164.  
  165. <center>
  166. <form action="" method="post">
  167. <textarea rows=10 cols=40 wrap=soft></textarea>
  168. <table border=0><center>
  169. <tr><td>
  170. <input type=button value="Example" onClick="example(this.form)">
  171. <input type=button value="Reverse" onClick="reverse()">
  172. <input type=button value="All Upper" onClick="caps()">
  173. <input type=button value="All Lower" onClick="lower()">
  174. </td>
  175. </tr>
  176. <tr>
  177. <td>
  178. <input type=button value="Ascii Example" onClick="exAscii()">
  179. <input type=button value="UnAscii" onClick="dontLikeThis()">
  180. <input type=button value="Ascii" onClick="whatIsThis()">
  181. <input type=button value="Clear It" onClick="reset()">
  182. </td>
  183. </tr>
  184. </table>
  185. </form>
  186. </center>
  187.  
  188. <!-- END OF SCRIPT -->
  189. <!/PREVIEW>
  190.  
  191. <!RELATED>NONE<!/RELATED>
  192.